﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.IO;
using Cassini;

namespace ExtToDestop
{
    static class Program
    {

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            Server s;
            string url = "";
            if (args.Length == 0)
            {
                url = "http://www.baidu.com/";
            }
            else
            {
                url = args[0];
            }
            StreamReader sr = File.OpenText(url);
            string textcontent = sr.ReadLine();
            sr.Close();

            textcontent = System.IO.Path.GetDirectoryName(url);

            s = new Server(3223,"/",textcontent);
            s.Start();
            //获得Asp.net文件所在目录

            //以这个目录为


            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Container(@"http://localhost:3223/"));
            s.Stop();
        }
    }
}
